package com.runa.monitor.platinterface.extend.hdb;

import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

@Slf4j
@Configuration
public class HdbProperty {
    private static String user;
    private static String ip;
    private static Integer port;
    private static Integer timeout;


    @Value("${hdb.user:rnzk}")
    public void setUser(String user) {
        log.info("setUser {}", user);
        HdbProperty.user = user;
    }

    @Value("${hdb.ip:10.2.1.53}")
    public void setIp(String ip) {
        log.info("setIp {}", ip);
        HdbProperty.ip = ip;
    }

    @Value("${hdb.port:9061}")
    public void setPort(Integer port) {
        log.info("setPort {}", port);
        HdbProperty.port = port;
    }

    @Value("${hdb.timeout:10000}")
    public void setTimeout(Integer timeout) {
        log.info("setTimeout {}", timeout);
        HdbProperty.timeout = timeout;
    }

    public static String getUser() {
        return user;
    }

    public static String getIp() {
        return ip;
    }

    public static Integer getPort() {
        return port;
    }

    public static Integer getTimeout() {
        return timeout;
    }

}
